package valeria;

public class J12SungJuk {
	public static void main(String[]args){
		
		SungJuk taehee = new SungJuk();
		SungJuk suji = new SungJuk();
		SungJuk jihyun = new SungJuk();
		
		taehee.name = "태희";
		taehee.kor = 99;
		taehee.eng = 89;
		taehee.mat = 79;
		System.out.println(taehee.name);
		System.out.println(taehee.getTotal());
		System.out.println(taehee.getAverage());
		System.out.println(taehee.getGrade());
		
		suji.name = "수지";
		suji.kor = 77;
		suji.eng = 37;
		suji.mat = 74;
		System.out.println(suji.name);
		System.out.println(suji.getTotal());
		System.out.println(suji.getAverage());
		System.out.println(suji.getGrade());

		jihyun.name = "지현";
		jihyun.kor = 66;
		jihyun.eng = 86;
		jihyun.mat = 26;
		System.out.println(jihyun.name);
		System.out.println(jihyun.getTotal());
		System.out.println(jihyun.getAverage());
		System.out.println(jihyun.getGrade());
		
	}

}//main

class SungJuk{
	String name;
	int kor,eng,mat,tot;
	double avg;
	char grd;
	
	public int getTotal(){
	return	kor+eng+mat;
		
	}
	
	public double getAverage(){
		return (double)getTotal()/3;
		
	}	
	
	public char getGrade(){
		switch((int)getAverage()/10){
		case 10:
		case 9:grd='수';break;
		case 8:grd='우';break;
		case 7:grd='미';break;
		case 6:grd='양';break;
		default : grd = '가';}
		return grd;
		}
	
} //class close
